﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace _07_03Mvvm模式
{
	public class Command : ICommand
	{
		public event EventHandler? CanExecuteChanged;

		public bool CanExecute(object? parameter)
		{
			return true;
		}


		//parameter可以通过xaml中的commandParameter传过来
		public void Execute(object? parameter)
		{
			//？是判断是否为空
			action?.Invoke();
		}

		public Action action { get; set; }
	}
}
